package com.zzptc.easyshop.servlet;

import com.zzptc.easyshop.dao.IDAO;
import com.zzptc.easyshop.dao.UserDao;
import com.zzptc.easyshop.vo.Users;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "UpdateServlet")
public class UpdateServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String id=request.getParameter( "userName" );
        String name=request.getParameter( "name" );
        String password=request.getParameter( "passWord" );
        String sex=request.getParameter( "sex" );
        String birthyear=request.getParameter( "birthyear" );
        String birthmonth=request.getParameter( "birthmonth" );
        String birthday=request.getParameter( "birthday" );
        String mobile=request.getParameter( "mobile" );
        String address=request.getParameter( "address" );

        Users users=new Users();
        users.setEu_user_id(  id);
        users.setEu_user_name( name );
        users.setEu_password( password );
        users.setEu_sex( sex );
        users.setEu_birthday( birthyear+"-"+birthmonth+"-"+ birthday);
        users.setEu_mobile( mobile );
        users.setEu_address(address );
        IDAO idao=new UserDao();
       ((UserDao) idao).isUserID( id );
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost( request,response );
    }
}
